<template>
  <div>
    <div class="corporation_name">
      <div>
        <div class="enterprise_icon" :style="{ background: color }">
          {{delAll.jkJbxxSfxx.shortName}}
        </div>
      </div>
      <div class="corporation_text">{{delAll.jkJbxxSfxx.d2CorpName}}</div>
    </div>
    <div class="echarts_box">
      <dashboard-echarts :score="this.score"></dashboard-echarts>
    </div>
    <div class="chart_data">
      <div class="chart_data_left">
        <div class="chart_data_number">{{ score }}</div>
        <div class="chart_data_title">空壳指数</div>
      </div>
      <div class="chart_data_middle">
        <div class="chart_data_number">{{ shellRating }}</div>
        <div class="chart_data_title">空壳等级</div>
      </div>
      <div class="chart_data_right">
        <div class="chart_data_text">
          <img src="~img/lookAround/tall.png" alt="" v-if="score >= 80" />
          <img
            src="~img/lookAround/centre.png"
            v-if="score >= 60 && score < 80"
            alt=""
          />
          <img src="~img/lookAround/low.png" v-if="score < 60" alt="" />
        </div>
        <div class="chart_data_title">空壳概率</div>
      </div>
    </div>
    <div class="tips" v-if="riskNum > 0">
      <div class="tips_icon"></div>
      <di class="tips_text">
        该企业存在
        <span class="tips_num">{{ riskNum }}</span
        >项异常特征，建议审慎审核对应企业
      </di>
    </div>
    <div class="tips2">
      提示:以上数据为苏州企业征信基于公开数据深度分析成果，
      苏州企业征信不对数据的全面、准确、真实、时效负责。
    </div>
  </div>
</template>
<script>
import { shell } from "@/interfaces/lookAround/index.js";
export default {
  name: "",
  /*1. Vue扩展 */
  extends: "", // extends和mixins都扩展逻辑，需要重点放前面
  mixins: [],
  components: {
    dashboardEcharts: () =>
      import("../../components/lookAround/dashboardEcharts"),
  },
  /* 2. Vue数据 */
  props: {},
  model: { prop: "", event: "" }, // model 会使用到 props
  data() {
    return {
      corpKey: "",
      score: 0,
      shellRating: 0,
      riskNum: 0,
      shortName: "",
      d2CorpName: "",
      delAll: {},
      color: "",
    };
  },
  computed: {},
  watch: {}, // watch 监控的是 props 和 data，有必要时监控computed
  /* 3. Vue资源 */
  filters: {},
  directives: {},
  /* 4. Vue生命周期 */
  created() {
    this.corpKey = this.$route.query.corpKey;
    this.color = this.$route.query.color;
    this.delAll = JSON.parse(this.$route.query.delAll);
    console.log(this.delAll, "this.delAll ");
    this.getLimit();
  },
  mounted() {},
  destroy() {},
  /* 5. Vue方法 */
  methods: {
    async getLimit() {
      let params = {
        corpKey: this.corpKey,
      };

      const res = await shell({ ...params });

      this.score = res.data.score;
      this.shellRating = res.data.shellRating;
      this.riskNum = res.data.riskNum;
      this.shortName = res.data.shortName;
      this.d2CorpName = res.data.d2CorpName;
      console.log(res, "this.score");
    },
  }, // all the methods should be put here in the last
};
</script>
<style lang="scss" scoped>
.enterprise_icon {
  width: 38px;
  height: 37px;
  line-height: 15px;
  padding: 4px 1px 1px 0;
  background-color: #d99d9a;
  font-size: 13px;
  color: white;
  text-align: center;
  border-radius: 5px;
  margin-top: 5px;
  // height: fit-content;
}
.corporation_name {
  display: flex;
  padding: 10px;
}
.corporation_text {
  font-size: 17.33px;
  color: #000000;
  font-family: "PuHuiTi65";
  margin-left: 10px;
}
.echarts_box {
  width: 100%;
  height: 200px;
  margin-top: 20px;
  // background-color: pink;
}
.chart_data {
  width: 318px;
  height: 75px;
  text-align: center;
  margin: auto;
  margin-top: 20px;
  border-radius: 15px;
  background-color: #f4f4f4;
  display: flex;
  justify-content: center;
  padding: 15px 0;
}
.chart_data_middle {
  margin-left: 40px;
}
.chart_data_right {
  margin-left: 40px;
}
.chart_data_number {
  font-size: 25px;
  font-weight: bold;
  font-family: YouSheBiaoTiHei;
  height: 30px;
  // background-color: red;
}
.chart_data_text {
  font-size: 21.9px;
  font-weight: bold;
  height: 30px;
  font-family: inherit;
  img {
    margin-top: 10px;
  }
}
.chart_data_title {
  font-size: 13px;
}
.tips {
  display: flex;
  width: 318px;
  margin: auto;
  font-size: 13px;
  align-items: center;
  background-color: #fff3f3;
  padding: 15px 8px;
  border-radius: 5px;
  margin-top: 15px;
}
.tips_icon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #eb6f64;
}
.tips_num {
  color: #eb6f64;
}
.tips_text {
  margin-left: 10px;
}
.tips2 {
  padding: 0 20px;
  margin-top: 20px;
  font-size: 13px;
  text-align: justify;
  line-height: 22px;
  font-size: 13px;
  color: #989898;
}
</style>
